package com.fks.fks_service.config;

import com.fks.fks_service.base.JsonResult;
import io.jsonwebtoken.ExpiredJwtException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value = ExpiredJwtException.class)
    @ResponseBody
    public JsonResult exceptionHandler(ExpiredJwtException e){
        System.out.println("全局异常捕获>>>:"+e);
        return JsonResult.error(-1,"请重新登录");
    }
}